import QtQuick 2.15
import QtQuick.Controls 2.15
import com.example.imageloader 1.0

ApplicationWindow {
    visible: true
    width: 800
    height: 600
    title: "图片选择器"

    ImageLoader {
        id: imageLoader
        onImageSelected: {
            imageView.source = filePath;
        }
    }

    Button {
        text: "选择图片"
        onClicked: imageLoader.selectImage()
    }

    Image {
        id: imageView
        anchors.centerIn: parent
        width: 400
        height: 400
        fillMode: Image.PreserveAspectFit
    }
}
